package com.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.item.mapper.UserInfoMapper;
import com.item.pojo.UserInfo;
import com.item.service.UserInfoService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, UserInfo> implements UserInfoService {

    @Override
    public UserInfo getLogin(String username, String password) {
        return super.baseMapper.getLogin(username, password);
    }

    @Override
    public boolean getEmail(String email) {
        if (super.baseMapper.getEmail(email) != null) {
            return true;
        }
        return false;
    }

    @Override
    public boolean getAddUser(UserInfo user) {
        return super.baseMapper.getAddUser(user) != 0 ? true : false;
    }

    @Override
    public boolean getUpdateUserPassword(String email, String password) {
        return super.baseMapper.getUpdateUserPassword(email, password) != 0 ? true : false;
    }
}
